1. Field of the Invention
The present invention relates to a device for detecting the removal of removable storage media such as removable hard disks, removable optical disks, floppy disk drives or the like and for accommodating the replacement of the removed storage media with media of different characteristics (for example, number of sectors, overall storage capacity, etc). More specifically, the present invention relates to a system and method for generating an operating system--detectable signal upon the removal of a removable storage medium from a computer system and for setting a flag readily accessible by the operating system indicating that the storage medium has been removed. Then, when a media operation such as a read or a write is requested, the flag is accessed to ascertain whether the removable storage medium has been removed. If it is determined that a new removable storage medium has been inserted, parameter information is read from the new removable storage medium in order to facilitate the requested media operation. This technique allows a removable storage medium from an existing removable storage media mechanism to be swapped "on the fly" with other storage media of varying sizes.
2. Related Art
Over the past decade, the tremendous popularity of personal and mini computers has spawned a growing demand for removable types of storage media such as floppy disks. This type of media enables users to easily store programs and data on a medium which can be removed and used later on the same or a different computer. In this way, the user is not tied down to using a specific computer. When they first became popular in the late 1970's and early 1980's, floppy disks offered a cheap alternative to hard disks, which in those years were large and expensive. In addition, floppy disks were easier to use than the tape drives or punch cards which were also in widespread use at that time.
At first, the formats for floppy disks had few variations, with one popular standard for a 51/4 inch disk using 40 concentric tracks and having a storage capacity of about 180 kilobytes on each side of the disk. However, over the years, other formats and capacities of disks have evolved. In particular, 51/4 inch 1.2 megabyte floppy disks and 31/2 inch 720 kilobyte and 1.44 megabyte floppy disks grew in popularity. Thus, both the 51/4 inch and the 31/2 inch floppy disks came in various formats, and disk drives were manufactured which could accommodate the varying formats. However, some way was needed to determine the format of a particular floppy disk when it was inserted and accessed in the disk drive.
One solution to this problem was to read certain information from the floppy disk prior to performing each disk operation. This is the approach taken with most conventional operating systems. More specifically, a "disk handler," which is part of the disk operating system, is loaded into main memory and facilitates disk operations (such as reads and writes). When an application program wishes to perform some disk operation, it typically makes a request to the disk handler to perform that function. Prior to that disk operation taking place, the disk handler (which is often a "block-type device driver") determines whether the disk has been replaced with a disk having a different format since the last disk operation by accessing certain information on the floppy disk. If the floppy disk has been changed in this manner, the disk handler obtains necessary parameter information from the floppy disk so that normal disk operations can then occur. An example of a widely-used disk handler is the one used with the MS-DOS operating systems (developed by Microsoft Corporation of Redmond, Wash.). This disk handler is receptive to certain commands which facilitate disk operations. Thus, application programs wishing to utilize the facilities of the disk handler must use these commands.
One of the commands supported by the MS-DOS disk handler (and by system BIOS's contemplated for use with MS-DOS) is a "media check" command. This command, which is typically executed prior to the commencement of each read or write operation, causes specified information to be read from the boot record of the floppy disk and compared with specified information previously read from the boot record. The results of this comparison indicate whether a floppy disk of differing format has been inserted since the last disk operation.
When a new floppy disk is determined to have been inserted, the "build bios parameter block" command of the MS-DOS disk handler is executed. This command reads the bios parameter block (BPB) of the floppy disk boot record and calculates various information necessary to facilitate disk operations. This information includes the number of disk sectors and the memory capacity of the floppy disk. Once this information is calculated, it is stored in a BPB table in computer memory and is used to facilitate read and write operations.
A further description of the disk handler used by MS-DOS can be found at Chapter 6 of The Waite Group's "MS-DOS Developers Guide" Second Edition, 1989 and also in the MS-DOS reference manual, version 5.0.
The problem with the approach described above for detecting the insertion of new media is that it is slow. Although this is the method that has been used for years, users are demanding faster response times from their computer equipment. Another problem is that most conventional operating systems and disk handlers do not accommodate various newer media forms such as removable hard disks. Often, the entire computer system must be shut off and various switches reset when one removable hard disk is replaced by another, particularly when the two are of different sizes. Even if a disk handler did accommodate a removable hard disk in the same way as for a floppy disk as described above, the access time to determine whether the medium has been removed would be unacceptable to many users, due to the greater complexity of the hard disk. Thus, adding a "hard disk media check" command to the disk handler, by itself, would not be a satisfactory solution.
In response to the problems raised above, some removable media developers have designed systems that employ specially-designed characteristic of the media to determine whether the media has been changed. One example of such a system is manufactured by DiscTec of Winter Park, Fla. and utilizes hard disks each having their own unique special code. This allows a specially-designed disk handler to read the special code to determine whether a new medium has been inserted subsequent to the last disk operation. Although techniques such as this are more efficient than the technique described above for floppy disks, flexibility is compromised since only hard disks having the unique characteristics can be used. In addition, it still requires a significant amount of time to read such special codes, especially if they contain large quantities of information.
Thus, it would be desirable to create a computer storage scheme which allows for the replacement of removable media of various sizes and formats manufactured by various vendors. Ultimately, it would be desirable to allow existing removable media systems (or their equivalents) to receive media of varying sizes from varying vendors and for the removable media to be replaceable with the same ease as replacing a floppy disk. Further, it is also desirable that detection of newly inserted media be executed quickly and without the necessity for the operating system to access and examine the media each time a disk operation is requested.